package com.pond.pond.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pond.common.core.annotation.Excel;
import com.pond.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;

/**
 * 钓技文章评论对象 fishing_technique_comment
 * 
 * @author pond
 * @date 2024-01-15
 */
public class FishingTechniqueComment extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 评论ID */
    private Long id;

    /** 文章ID */
    @Excel(name = "文章ID")
    private Long techniqueId;

    /** 评论用户ID */
    @Excel(name = "评论用户ID")
    private Long userId;

    /** 父评论ID，0表示顶级评论 */
    @Excel(name = "父评论ID")
    private Long parentId;

    /** 评论内容 */
    @Excel(name = "评论内容")
    private String content;

    /** 点赞数 */
    @Excel(name = "点赞数")
    private Integer likeCount;

    /** 状态：0-禁用，1-启用 */
    @Excel(name = "状态")
    private String status;

    /** 是否已点赞（查询时使用） */
    private Boolean isLiked;

    /** 用户信息（查询时使用） */
    private UserInfo user;

    /** 回复列表（查询时使用） */
    private List<FishingTechniqueComment> replies;

    /** 文章标题（后台管理查询时使用） */
    private String techniqueTitle;

    /** 用户名（后台管理查询时使用） */
    private String userName;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setTechniqueId(Long techniqueId) 
    {
        this.techniqueId = techniqueId;
    }

    public Long getTechniqueId() 
    {
        return techniqueId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setParentId(Long parentId) 
    {
        this.parentId = parentId;
    }

    public Long getParentId() 
    {
        return parentId;
    }
    public void setContent(String content) 
    {
        this.content = content;
    }

    public String getContent() 
    {
        return content;
    }
    public void setLikeCount(Integer likeCount) 
    {
        this.likeCount = likeCount;
    }

    public Integer getLikeCount() 
    {
        return likeCount;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public Boolean getIsLiked() {
        return isLiked;
    }

    public void setIsLiked(Boolean isLiked) {
        this.isLiked = isLiked;
    }

    public UserInfo getUser() {
        return user;
    }

    public void setUser(UserInfo user) {
        this.user = user;
    }

    public List<FishingTechniqueComment> getReplies() {
        return replies;
    }

    public void setReplies(List<FishingTechniqueComment> replies) {
        this.replies = replies;
    }

    public String getTechniqueTitle() {
        return techniqueTitle;
    }

    public void setTechniqueTitle(String techniqueTitle) {
        this.techniqueTitle = techniqueTitle;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("techniqueId", getTechniqueId())
            .append("userId", getUserId())
            .append("parentId", getParentId())
            .append("content", getContent())
            .append("likeCount", getLikeCount())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }

    /**
     * 用户信息内部类
     */
    public static class UserInfo {
        private Long id;
        private String nickName;
        private String avatar;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getNickName() {
            return nickName;
        }

        public void setNickName(String nickName) {
            this.nickName = nickName;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }
    }
}